<div class="form">

<?php 
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/jquery.number_format.js", CClientScript::POS_END);

$form=$this->beginWidget('CActiveForm', array(
	'id'=>'drink-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); 
?>
    
	<?php echo $form->errorSummary($model); ?>
        <?php echo $this->renderFlash(); ?>

        <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
            <tr>
                <th valign="top"><?php echo $form->labelEx($model,'drinktypeid'); ?></th>
                <td><?php echo $form->dropDownList($model,'drinktypeid',  CHtml::listData(Drinktype::model()->findAll(), 'drinktypeid', 'drinktypename'), array('class' => 'styledselect_form_1')); ?></td>
                <td></td>
            </tr>
            <tr>
                <th valign="top"><?php echo $form->labelEx($model,'drinkname'); ?></th>
                <td><?php echo $form->textField($model,'drinkname',array('rows'=>6, 'cols'=>50, 'class' => 'inp-form')); ?></td>
                <td></td>
            </tr>
            <tr>
                <th valign="top"><?php echo $form->labelEx($model,'drinkprice'); ?></th>
                <td><?php echo $form->textField($model,'drinkprice', array('class' => 'inp-form', 
                    'onkeyup' => '
                            var format_number = $().number_format($(this).val().replace(/\s/g, ""), {
                                numberOfDecimals:0,
                                decimalSeparator: ",",
                                thousandSeparator: " "
                            });

                            $(this).val(format_number);
                        ',
                    'value' => number_format($model->drinkprice, 0, "", " "),
                    'onfocus' => '$(this).select()'
                    )); ?></td>
                <td></td>
            </tr>
            <tr>
                <th valign="top"><?php echo $form->labelEx($model,'imgpath'); ?></th>
                <td><?php echo $form->fileField($model,'imgpath' ,array('class' => 'file_1')); ?></td>
                <td></td>                
            </tr>           
            <tr>
                <th>&nbsp;</th>
                <td valign="top">
                    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'form-submit')); ?>
                </td>
                <td></td>
            </tr>
        </table>
<?php $this->endWidget(); ?>

</div><!-- form -->